<template>
  <div>
    <el-button type="success" @click="add">添加</el-button>
    <el-button type="success" v-if="isPaging" @click="nopaging">不分页</el-button>
    <el-button type="success" v-else @click="paging">分页</el-button>
    <v-list></v-list>
    <v-dialog></v-dialog>
  </div>
</template>

<script>
import {mapGetters,mapActions} from 'vuex'
import vDialog from './components/Dialog'
import vList from './components/List.vue'
export default {
  components:{
    vDialog,
    vList
  },
  computed:{
        ...mapGetters({
            "info":"goods/info",
            "isPaging":"goods/isPaging",
        })
  },
  methods:{
    ...mapActions({
      "requestIsPaging":"goods/isPagingActions",
      "requestGoodsList":"goods/goodsListActions",
    }),
    add(){
      this.info.isShow = true;
      this.info.title = "商品添加";
      this.info.isAdd = true;
    },
    paging(){
      this.requestIsPaging(true)
      this.requestGoodsList()
    },
    nopaging(){
      this.requestIsPaging(false)
      this.requestGoodsList()
    },
  },
  mounted(){
    document.title = this.$route.meta.title
  },
}
</script>

<style>
</style>